import { VuexModule, Module, Mutation, Action, getModule } from 'vuex-module-decorators'
import store from '@/store'

export interface IAppState {
  msg: string
}

// vuex demo
@Module({ dynamic: true, store, name: 'msg' })
class Navbar extends VuexModule implements IAppState {
  public msg = ''
  @Mutation
  private SET_MSG(str) {
    this.msg = str
  }

  @Action
  public setMsg(str) {
    this.SET_MSG(str)
  }
}

export const appModule = getModule(Navbar)
